@extends('extend.admin')

@section('title','分类列表')

@section('content')
  <section id="main-content"> 
   <div class="row"> 
    <div class="col-md-12"> 
     <!--breadcrumbs start --> 
     <ul class="breadcrumb"> 
      <li><a href="#">首页</a> </li> 
      <li>分类管理</li> 
      <li class="active">分类列表</li> 
     </ul> 
     <!--breadcrumbs end --> 
     <h1 class="h1">分类列表</h1> 
    </div> 
   </div> 
   <div class="row"> 
    <div class="col-md-12"> 
     <div class="panel panel-default"> 
      <div class="panel-heading"> 
       <h3 class="panel-title">分类列表</h3> 
       <div class="actions pull-right"> 
        <i class="fa fa-chevron-down"></i> 
       </div> 
      </div> 
      <div class="panel-body"> 
       <div role="grid" id="example_wrapper" class="dataTables_wrapper form-inline no-footer">
        <div class="row">
        </div>
        <table id="example" class="table table-striped table-bordered dataTable no-footer" aria-describedby="example_info" style="width: 100%;" width="100%" cellspacing="0"> 
         <thead> 
          <tr role="row">
           <th class="sorting" tabindex="0" aria-controls="example" rowspan="1" colspan="1" style="width: 100px;" aria-sort="ascending" aria-label="Name: activate to sort column ascending">分类ID</th>
           <th class="sorting" tabindex="0" aria-controls="example" rowspan="1" colspan="1" style="width: 108px;" aria-label="Position: activate to sort column ascending">分类名称</th>
           <th class="sorting" tabindex="0" aria-controls="example" rowspan="1" colspan="1" style="width: 124px;" aria-label="Office: activate to sort column ascending">父级分类</th>
           <th class="sorting" tabindex="0" aria-controls="example" rowspan="1" colspan="1" style="width: 124px;" aria-label="Age: activate to sort column ascending">路径</th>
           <th class="sorting" tabindex="0" aria-controls="example" rowspan="1" colspan="1" style="width: 111px;" aria-label="Start date: activate to sort column ascending">状态更改</th>
           <th class="sorting" tabindex="0" aria-controls="example" rowspan="1" colspan="1" style="width: 174px;" aria-label="Salary: activate to sort column ascending">操作</th>
          </tr> 
         </thead> 
         <tbody>
         @foreach($types as $k=>$v) 
          <tr class="odd"> 
           <td class="sorting_1">{{$v->id}}</td> 
           <td>{{$v->name}}</td> 
           <td>{{$v->pid}}</td> 
           <td>{{$v->path}}</td> 
           <td>{{$v->status}}</td> 
           <td class="text-center">
             <a href="/type/edit?id={{$v->id}}">修改</a><span class="glyphicon glyphicon-pencil"></span>&nbsp;&nbsp;&nbsp;&nbsp;
             <a class="que" href="/type/drop?id={{$v->id}}">删除</a><span class="glyphicon glyphicon-trash"></span>&nbsp;&nbsp;&nbsp;&nbsp;
           </td> 
          </tr>
          @endforeach
         </tbody> 
        </table>
        <script type="text/javascript">
          var asd=document.getElementsByClassName('que');
          for(var i=0;i<asd.length;i++){
            asd[i].onclick=function(){
              var type=confirm("此操作不可逆转,你确信要删除?")
              if(!type){
                return false;
              }else{
                return true;
              }
            }
          }
        </script>
        <div class="row">
         <div class="col-xs-6">
         </div>
        </div>
       </div> 
      </div> 
     </div> 
    </div> 
   </div> 
  </section>
@endsection